<template>
    <div class="UserCenter">
        <div class="info">
            <div class="user">
                <img src="../../assets/logo.png" alt="">
                <div>
                    <p>
                        <span class="nickName">Linda Smith</span>
                        <span class="vipType">体验会员</span>
                    </p>
                    <p><span class="phone DIN-Medium">15954231666</span></p>
                </div>
            </div>
            <div class="vipProgress">
                <div class="progress">
                    <div class="value" :style="progressStyle">
                        <div class="text DIN-Medium">35</div>
                    </div>
                </div>
                <div class="about">
                    <div class="need">升级还需要 <span class="DIN-Medium">65</span></div>
                    <div class="current DIN-Medium">A3</div>
                </div>
            </div>
            <!--<div class="vipBuy">-->
                <!--<span class="time">有效期 2020-10-09</span>-->
                <!--<span class="vipBtn">购买会员</span>-->
                <!--<span class="vipBtn">会员权益</span>-->
            <!--</div>-->
        </div>
        <div class="list">
            <div v-for="(item, index) in list" :key="index" class="cell active-black" @click="didClick(item)">
                <div class="title">
                    <gy-icon :fontName="item.icon"/>
                    <span class="text">{{item.title}}</span>
                </div>
            </div>
        </div>
    </div>
</template>

<script lang="ts">
    import {Component, Vue} from 'vue-property-decorator'
    import GyIcon from "../../components/GyIcon.vue";
    import {NAV_BAR_INFO} from "@/store/MutationTypes";

    @Component({
        name: 'UserCenter',
        components: {GyIcon}
    })
    export default class extends Vue {
        private list: any[] = [
            { icon: 'icon-icon_cmail', title: '钱包', path: '/wallet' },
            { icon: 'icon-fenxiang', title: '我的战队', path: '/warband' },
            { icon: 'icon-fenxiang', title: '外汇培训', path: '' },
            { icon: 'icon-2', title: '客服', path: '' },
            { icon: 'icon-icon_boss_fill', title: '关于我们', path: '/about' },
            { icon: 'icon-shezhi', title: '设置', path: '/setting' },
        ];
        private mounted(): void {
            this.$common.scrollToTop();
            this.$store.dispatch(NAV_BAR_INFO, {})
        }
        private get progressStyle(): string {
            return 'width: 40%;'
        }
        private didClick(item: any): void {
            this.$router.push(item.path);
        }
    }
</script>

<style scoped lang="less">
    .UserCenter {
        padding: 0.2rem 0.3rem;
        & .info {
            width: 6.9rem;
            height: 2.8rem;
            background-color: white;
            border-radius: 0.1rem;
            padding: 0.4rem;
            color: #666666;
            & .user {
                display: flex;
                flex-direction: row;
                justify-content: flex-start;
                align-items: center;
                & img {
                    width: 1.0rem;
                    height: 1.0rem;
                    border-radius: 1.0rem;
                    border: 0.02rem solid rgba(151,151,151,1)
                }
                & p {
                    text-align: left;
                    display: flex;
                    flex-direction: row;
                    justify-content: flex-start;
                    align-items: center;
                    height: 0.54rem;
                }
                & .nickName {
                    font-size: 0.36rem;
                    padding: 0 0.2rem;
                    font-weight: 600;
                    line-height: 0.2rem;
                }
                & .vipType {
                    font-size: 0.24rem;
                    padding: 0.02rem 0.3rem;
                    border-radius: 0.4rem;
                    color: #FAE100;
                    /*border: 0.02rem solid #979797;*/
                    background:linear-gradient(308deg,rgba(115,115,115,1) 0%,rgba(34,34,34,1) 100%);
                }
                & .phone {
                    font-size: 0.3rem;
                    padding: 0 0.2rem;
                }
            }
            & .vipProgress {
                padding: 0.4rem 0.2rem;
                & .progress {
                    height: 0.06rem;
                    border-radius: 0.2rem;
                    position: relative;
                    background-color: #F2F2F2;
                    & .value {
                        position: absolute;
                        left: 0;
                        height: 0.06rem;
                        top: 0;
                        bottom: 0;
                        border-radius: 0.2rem;
                        background:linear-gradient(136deg,rgba(115,115,115,1) 0%,rgba(34,34,34,1) 100%);
                        & .text {
                            position: absolute;
                            bottom: 0.08rem;
                            right: -0.2rem;
                            background:linear-gradient(302deg,rgba(115,115,115,1) 0%,rgba(34,34,34,1) 100%);
                            color: #FAE100;
                            padding: 0.00rem 0.1rem;
                            border-radius: 0.4rem;
                            font-size: 0.2rem;
                        }
                    }
                }
                & .about {
                    display: flex;
                    flex-direction: row;
                    justify-content: space-between;
                    align-items: flex-start;
                    font-size: 0.24rem;
                    padding-top: 0.06rem;
                }
            }
        }
        & .list {
            & .cell {
                width: 6.9rem;
                height: 1.0rem;
                background-color: white;
                border-radius: 0.1rem;
                margin-top: 0.2rem;
                padding: 0.3rem;
                display: flex;
                flex-direction: row;
                justify-content: space-between;
                align-items: center;
                position: relative;
                overflow: hidden;
                color: #666666;
                /*&:after {*/
                /*    content: "";*/
                /*    position: absolute;*/
                /*    left: 0;*/
                /*    top: 0;*/
                /*    right: 0;*/
                /*    bottom: 0;*/
                /*    z-index: 2;*/
                /*}*/
                /*&:active {*/
                /*    &:after {*/
                /*        background-color: rgba(0, 0, 0, .1);*/
                /*    }*/
                /*}*/
                & .title {
                    display: flex;
                    flex-direction: row;
                    justify-content: flex-start;
                    align-items: center;
                    & .text {
                        margin-left: 0.2rem;
                    }
                }
            }
        }
    }
</style>
